package com.online.study.content.controller;

import com.online.study.content.model.dto.CourseBaseDto;
import com.online.study.content.model.dto.QueryCourseParamsDto;
import com.online.study.content.service.CourseBaseService;
import com.online.study.model.Page;
import com.online.study.model.PageParams;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/course")
public class CourseController {

    @Resource
    private CourseBaseService courseBaseService;


    @PostMapping("/list")
    public Page<CourseBaseDto> list(PageParams params,
                                    @RequestBody QueryCourseParamsDto queryCourseParamsDto){
        //调用service获取数据
        return courseBaseService.queryCourseBaseList(params, queryCourseParamsDto);
    }

}
